Domain Model
Domain Model is a representation of real-world concept or classes, it is also known as conceptual model. Domain model focuses on one domain only. A domain model is illustrated with class diagrams with no operations specified. A Unified Process (UP) considers domain model as a visualization of real-world concept of domain of interest. Software artifacts like windows, or a database, responsibilities or methods are not suitable in a domain model. Domain model shows
A conceptual class is an idea, thing or object. Conceptual class can be considered as symbol, intension and extension.
Sale is a conceptual class of the purchase event. The intension of sale is to represent the act of purchase, it has date, product name, quantity, unit price etc. All the sales in the universe are extension of sale.
Domain model is not Data model. Data model shows persistent data to be stored in persistent storage. Domain model is created to lower the representation gap between user’s mental and software models.
Following steps are taken to create Domain Model:
It is a mistake to consider something as an attribute when it is a conceptual class. If something cannot be assigned a number or a text in the real world, then consider that something a conceptual class, not an attribute. For example, name can be assigned a value like "Sachin", but a person cannot be specified with a single number or value. So, a person is a conceptual class.
Use description class when:
An association is a relationship between classes that shows some meaningful and interesting connection. Association between objects are created if some memory of the relationships has to be maintained for some time. For example, we need to remember which Borrow instance is associated with which book and student, so we make borrow as an association between student and book. Verbs are used to name associations.